<!DOCTYPE html>
<html id="simpleViewer">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

            <link href="images/readium_favicon.png" rel="shortcut icon"/>
            <link href="images/readium-touch-icon.png" rel="apple-touch-icon"/>

    <link rel="stylesheet" type="text/css" href="css/readium-all.css">

    <script type="text/javascript" src="scripts/readium-js-viewer_all_LITE.js"> </script>

    <script type="text/javascript" src="font-faces/fonts.js"> </script>

<script type="text/javascript">

var path = (window.location && window.location.pathname) ? window.location.pathname : ''; 

// extracts path to index.html (or more generally: /PATH/TO/*.[x]html)
path = path.replace(/(.*)\/.*\.[x]?html$/, "$1");

// removes trailing slash
path = path.charAt(path.length-1) == '/'
          ? path.substr(0, path.length-1)
          : path;
          
var HTTPServerRootFolder =
window.location ? (
  window.location.protocol
  + "//"
  + window.location.hostname
  + (window.location.port ? (':' + window.location.port) : '')
  + path
  ) : ''
;

console.log(HTTPServerRootFolder);

var fontsArray = [];
if (typeof getFontFaces != "undefined") { // defined externally
    fontsArray = getFontFaces(HTTPServerRootFolder + "/font-faces/");
}

// MUST BE *SINGLE* CALL TO require.config() FOR ALMOND (SINGLE BUNDLE) TO WORK CORRECTLY!!!
require.config({
    /* http://requirejs.org/docs/api.html#config-waitSeconds */
    waitSeconds: 0,

    config : {

        'readium_js_viewer/ModuleConfig' : {

            'mathJaxUrl': HTTPServerRootFolder + '/scripts/mathjax/MathJax.js',
            
            'fonts': fontsArray,

            'annotationCSSUrl': HTTPServerRootFolder + '/css/annotations.css',

            'jsLibRoot': HTTPServerRootFolder + '/scripts/zip/',

            'useSimpleLoader' : false, // cloud reader (strictly-speaking, this config option is false by default, but we prefer to have it explicitly set here).

            'epubLibraryPath': '/epub_content/', // defaults to /epub_content/epub_library.json relative to the application's root index.html ... that being said, this is cloud reader LITE (no library view!)

            'imagePathPrefix': undefined,

            'canHandleUrl' : false,
            'canHandleDirectory' : false,


            'workerUrl': undefined,
            'epubReadingSystemUrl': undefined
        }
    }
});
</script>

    </head>

    <!-- This is all application-specific HTML -->
    <body>
        <nav id="app-navbar" class="navbar" role="banner" aria-label="{{Strings.i18n_toolbar}}">
        </nav>
        <div id="app-container">
        </div>
    </body>

</html>
